package com.cy.pj.sys.dao.impl;

import com.cy.pj.sys.dao.SysNoticeDao;
import com.cy.pj.sys.pojo.SysNotice;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository //底层创建的实现类默认名字是实现类的名字，首字母小写
public class SysNoticeDaoImpl implements SysNoticeDao {
    @Autowired
    private SqlSession sqlSession;

    @Override
    public List<SysNotice> selectNotices(SysNotice notice) {
        String interfacename = this.getClass().getInterfaces()[0].getName();
        //String classname = SysNoticeDao.class.getName();
        String MethodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        String statement = interfacename + "." + MethodName;
        List<SysNotice> list = sqlSession.selectList(statement,notice);
        return list;
 }

    @Override
    public int deleteById(Long... id) {
        return 0;
    }

    @Override
    public SysNotice selectById(Long id) {
        return null;
    }

    @Override
    public int insertNotice(SysNotice notice) {
        return 0;
    }

    @Override
    public int updateNotice(SysNotice notice) {
        return 0;
    }

    @Override
    public void updateByID(String title) {

    }
}
